package com.link2room.soundwave.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * @author sqj88
 * @date 2018/2/5 15:15
 */
@Entity
@Table(name = "pms_package_sale")
@DynamicInsert
public class PmsPackageSale extends BaseEntity{
    private String l2RMemberNo;
    private String orderNo;
    private String exchangeType;
    private String activityCode;
    private BigDecimal pointValue;
    private BigDecimal amountValue;
    private String isSuccess;

    @Basic
    @Column(name = "l2r_member_no", nullable = false, length = 32)
    public String getL2RMemberNo() {
        return l2RMemberNo;
    }

    public void setL2RMemberNo(String l2RMemberNo) {
        this.l2RMemberNo = l2RMemberNo;
    }

    @Basic
    @Column(name = "order_no", nullable = false, length = 32)
    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    @Basic
    @Column(name = "exchange_type", nullable = true, length = 32)
    public String getExchangeType() {
        return exchangeType;
    }

    public void setExchangeType(String exchangeType) {
        this.exchangeType = exchangeType;
    }

    @Basic
    @Column(name = "activity_code", nullable = true, length = 64)
    public String getActivityCode() {
        return activityCode;
    }

    public void setActivityCode(String activityCode) {
        this.activityCode = activityCode;
    }

    @Basic
    @Column(name = "point_value", nullable = true, precision = 2)
    public BigDecimal getPointValue() {
        return pointValue;
    }

    public void setPointValue(BigDecimal pointValue) {
        this.pointValue = pointValue;
    }

    @Basic
    @Column(name = "amount_value", nullable = true, precision = 2)
    public BigDecimal getAmountValue() {
        return amountValue;
    }

    public void setAmountValue(BigDecimal amountValue) {
        this.amountValue = amountValue;
    }

    @Basic
    @Column(name = "is_success", nullable = true, length = 2)
    public String getIsSuccess() {
        return isSuccess;
    }

    public void setIsSuccess(String isSuccess) {
        this.isSuccess = isSuccess;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PmsPackageSale that = (PmsPackageSale) o;

        if (l2RMemberNo != null ? !l2RMemberNo.equals(that.l2RMemberNo) : that.l2RMemberNo != null) return false;
        if (orderNo != null ? !orderNo.equals(that.orderNo) : that.orderNo != null) return false;
        if (exchangeType != null ? !exchangeType.equals(that.exchangeType) : that.exchangeType != null) return false;
        if (activityCode != null ? !activityCode.equals(that.activityCode) : that.activityCode != null) return false;
        if (pointValue != null ? !pointValue.equals(that.pointValue) : that.pointValue != null) return false;
        if (amountValue != null ? !amountValue.equals(that.amountValue) : that.amountValue != null) return false;
        if (isSuccess != null ? !isSuccess.equals(that.isSuccess) : that.isSuccess != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = l2RMemberNo != null ? l2RMemberNo.hashCode() : 0;
        result = 31 * result + (orderNo != null ? orderNo.hashCode() : 0);
        result = 31 * result + (exchangeType != null ? exchangeType.hashCode() : 0);
        result = 31 * result + (activityCode != null ? activityCode.hashCode() : 0);
        result = 31 * result + (pointValue != null ? pointValue.hashCode() : 0);
        result = 31 * result + (amountValue != null ? amountValue.hashCode() : 0);
        result = 31 * result + (isSuccess != null ? isSuccess.hashCode() : 0);
        return result;
    }
}
